package com.dingreading.cloud.web.util;

import com.dingreading.cloud.common.util.aliyun.AliyunMessageUtils;
import com.dingreading.cloud.web.entity.NjTicketUser;
import lombok.SneakyThrows;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 异步发送短信
 */
@Component
public class MsgTask {

    @SneakyThrows
    @Async
    public void sendMsg(String accessKeyId, String accessKeySecret, List<NjTicketUser> userList) {
        for (NjTicketUser user : userList) {
//            String s = AliyunMessageUtils.acecSendTicketFee(accessKeyId, accessKeySecret, user.getPhone(), user.getUid());
//            System.out.println("s = " + s);
            System.out.println("user.getPhone() = " + user.getPhone());
        }
    }

}
